#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <cmath>
#include <time.h>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <assert.h>
#include <cstdlib>
#include <cstring>

using namespace std;

typedef long long ll;
typedef double db;
typedef string str;
typedef unsigned int uint;

#define forn(i, n) for (int i = 0; i < n; ++i) 
#define INF 1e+9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define mp(a, b) make_pair(a, b)
#define pb(a) push_back(a)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pdd pair<db, db>
#define sz(a) ( (int) a.size() )
#define len(a) ( (int) a.length() )
#define ms(x) memset(x, 0, sizeof(x))
#define ms1(x) memset(x, -1, sizeof(x))
#define L(a) sz(a)
#define X first
#define Y second
#define ALL(a) a.begin(), a.end()

struct num{
	double a, b, c;
	double x, y;
	bool ispoint;
	num(double x, double y) : x(x), y(y), ispoint(true) { }
	num(double a, double b, double c) : a(a), b(b), c(c), ispoint(false) { }
};

num make_line(num a, num b){
	double A = a.y - b.y;
	double B = b.x - a.x;
	double C = -(a.x * A + a.y * B);
	return num(A, B, C);
}

num mir(num a, num b){
	double A = b.a;
	double B = b.b;
	double C = b.c;
	double k = -2 * (C + a.x * A + a.y * B) / (A * A + B * B);
	return num(a.x + k * A, a.y + k * B);
}

double det(double a11, double a12, double a21, double a22){
	return a11 * a22 - a12 * a21;
}

num inters(num a, num b){
	double d = det(a.a, a.b, b.a, b.b);
	double d1 = det(-a.c, a.b, -b.c, b.b);
	double d2 = det(a.a, -a.c, b.a, -b.c);
	return num(d1 / d, d2 / d);
}

string s;

int getint(string s){
	int ans = 0;
	int sign = 1;
	if (s[0] == '-'){ 
		sign *= -1;
		s.erase(0, 1);
	}
	forn(i, sz(s)) ans = ans * 10 + s[i] - '0';
	return sign * ans;
}

num parse(int l, int r){
	//cerr << s.substr(l, r-l+1) << "\n";
	int cnt = 0;
	int tt = -1;
	for(int i=l; i<=r; i++)
		if (s[i] == '(' && s[i] == '(') cnt++;
		else if (s[i] == ',') tt = i;
	if (!cnt){
		int x = getint(s.substr(l, tt - l));
		int y = getint(s.substr(tt + 1, r - tt));
		return num(x, y);
	}
	int bal = 0;
	for(int i=r; i>=l; i--){
		if (s[i] == ')') bal++;
		if (s[i] == '(') bal--;
		if (bal == 0){
			tt = i;
			break;
		}
	}
	if (tt == l) return parse(l+1, r-1);
	num ls = parse(l, tt - 2);
	num rs = parse(tt, r);
	if (!ls.ispoint) swap(ls, rs);
	if (!ls.ispoint) return inters(ls, rs);
	if (rs.ispoint) return make_line(ls, rs);
	return mir(ls, rs);
}

bool solve(){
	cin >> s;
	if (s == "#") return false;
	num ans = parse(0, sz(s) - 1);
	printf("%.15lf %.15lf\n", ans.x, ans.y);
	return true;
}

int main(){
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#else
    /*freopen(".in", "r", stdin);
    freopen(".out", "w", stdout);*/
#endif
	while(solve());
#ifdef _DEBUG
    cout << fixed << setprecision(15) << "\n" << clock() * 1.0 / CLOCKS_PER_SEC;
#endif
    return 0;
}